#ifndef NetAwaiter_H
#define NetAwaiter_H

#include <QNetworkReply>

#include "ccoroutine_qt_global.h"
#include "awaiters.h"
namespace CCoroutine{

class CCoroutineQt_EXPORT NetAwaiter:public AwaiterBase
{
public:
    NetAwaiter(QNetworkReply* reply);
    ~NetAwaiter();
protected:
    bool ready();
    void suspend(PromiseBase* ctx);
    void resume();
private:
    QNetworkReply* reply = nullptr;
    QMetaObject::Connection con;
};
}

CCoroutineQt_EXPORT CCoroutine::AwaiterBase* getAwaiter(QNetworkReply *timer);
CCoroutineQt_EXPORT CCoroutine::AwaiterBase* getAwaiter(QNetworkReply &timer);
#endif
